﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class Trang_web_Trang_lien_lac : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
            LabelPass.Text = Ma_Ngau_Nhien.MaNgauNhien_SoChu(7);
    }
    protected void btnGui_Click(object sender, EventArgs e)
    {
        if (txtPass.Text.ToString() == LabelPass.Text.ToString())
        {
            string mbody = "Họ tên:" + txtHoTen.Text + "<br/>Nội dung:" + txtNoiDung.Value;
            string mfrom = txtEmail.Text;
            //string mto = "akami.nguyen@gmail.com";
            string mto = "nobitaxaiv3@gmail.com";
            string msubject = "THƯ LIÊN LẠC TỬ TRANG WEB BOOK IDEAS";
            Send_Email.sendmail(mfrom, mto, msubject, mbody);
            LabelPass.Text = Ma_Ngau_Nhien.MaNgauNhien_SoChu(7);
            LabelThanhCong.Visible = true;
            LabelThanhCong.Text = "Thành công";
        }
        else
        {
            LabelPass.Text = Ma_Ngau_Nhien.MaNgauNhien_SoChu(7);
            LabelThanhCong.Visible = true;
            LabelThanhCong.Text = "Sai mã bảo vệ";
        }
    }


    protected void btnR_Click(object sender, ImageClickEventArgs e)
    {
        LabelPass.Text = Ma_Ngau_Nhien.MaNgauNhien_SoChu(7);
    }
}